package org.extremengine.shape;

import org.extremengine.common.Point;

/**
 * 无限长水平线。
 * @author yuxing
 * 
 */
public class HorizontalLine extends UnlimitedLine {

	private double y;

	public HorizontalLine(double y) {
		super();
		this.y = y;
	}

	public HorizontalLine(double y, int freeSpace) {
		super(freeSpace);
		this.y = y;
	}

	@Override
	public Point getBarycenter() {
		throw new UnsupportedOperationException();
	}

	@Override
	public void transform(double deltax, double deltay) {
		this.y += deltay;
	}

	public double getY() {
		return y;
	}

	public void setY(double y) {
		this.y = y;
	}

	@Override
	public String toString() {
		return "HLine:" + y;
	}

	@Override
	public Shape clone() {
		return new HorizontalLine(this.y);
	}
}
